package com.test.demo.nacos;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author laigl
 * @ClassName
 * @Description
 * @Date 2020/01/07 18:01
 */
@SpringBootApplication
public class Application {

    public static void main(String[] args) {
        SpringApplication.run(Application.class, args);
    }

    @RefreshScope
    @RestController
    static class TestController {

        @Value("${my.title}")
        private String title;


        @GetMapping("test")
        public String test() {
            return "title = " + title;
        }
    }

}
